package cn.edu.hhu.servlet.student;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @anthor: lddd
 * @date: 2020/5/20 - 14:30
 * @description:
 **/
@WebServlet("/student/signoutServlet")
public class StudentSignoutServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //把session里的登录信息删除
        request.getSession().setAttribute("loginStudent",null);
        //跳转到登陆页面
        response.sendRedirect(request.getContextPath()+"/index.jsp");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
